#include<bits/stdc++.h>

using namespace std;

int main() {
	vector<int> a = {1,2,3,9}; //9321
	vector<int> b = {9,8,7}; //0789
	vector<int> c;

	if(a.size()<b.size())swap(a,b);
	b.resize(a.size());
	c.resize(a.size()) ;
	int cs=0;
	for(int i=0; i<a.size(); i++) {
		int temp=a[i]+b[i]+cs;
		c[i]=temp%10;
		cs=temp/10;

	}
	if(cs>0) {
		c.push_back(cs);
	}
	copy(c.rbegin(), c.rend(), ostream_iterator<int>(cout, ""));

	return 0;
}
